<template>
	<uni-nav-bar :title="userInfo.staffBanInfo.title+'班次'" left-icon="left" @clickLeft="navBack" :fixed="true" statusBar
		rightText="打卡记录" @clickRight="navTo('Sale/checkWork/checkRecords?id='+banID)"></uni-nav-bar>
	<view class="package_sale" v-if="userInfo.staffBanInfo">
		<view>{{userInfo.staffBanInfo.title}}</view>
		<view class="top" v-for="(item,index) in userInfo.staffBanInfo.staff_list" :key="index">
			{{item.staff_name}}（{{item.zhiwu}}）
		</view>
	</view>
	<view class="package_sale" v-if="userInfo.staffBanInfo">
		<view>总收益:{{userInfo.staffBanInfo.shouyi}}元</view>
		<view class="top">加注量:{{userInfo.staffBanInfo.amount}}公斤 </view>
		<view class="top">加注单:{{userInfo.staffBanInfo.nums}}单</view>
	</view>
	<view class="package_sale" style="paddingTop:1rpx" v-if="userInfo.staffBanInfo">
		<view class="space-between top" v-for="(item,index) in userInfo.staffBanInfo.staff_list" :key="index">
			<view>{{item.zhiwu}}收益：{{item.filling_shouyi}}</view>
			<view>{{item.zhiwu}}比例：{{item.bfb}}</view>
		</view>
		<view class="space-between top" v-if="userInfo.staffBanInfo">
			<view>照片</view>
			<image :src="userInfo.staffBanInfo.image" mode=""></image>
		</view>
	</view>
</template>

<script setup lang="ts">
	import { navBack, navTo } from '@/utils/navigator';
	import { ref } from 'vue';
	import { onLoad } from '@dcloudio/uni-app';
	import { useUserInformation } from '@/stores/earthPushing/userSale';
	const userInfo = useUserInformation();
	const banID = ref()
	onLoad((pearm) => {
		banID.value = Number(pearm.id)
		userInfo.getStaffBan(banID.value);
	})
</script>

<style scoped lang="less">
	.top {
		margin-top: 20rpx;
	}

	image {
		width: 200rpx;
		height: 200rpx;
		border-radius: 5px;
	}
</style>